package com.wei.duowan.bbs.ui.activity;


import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.wei.duowan.bbs.R;
import com.wei.duowan.bbs.presenter.BasePresenter;
import com.wei.duowan.bbs.ui.adapter.BaseRecyclerViewAdapter;
import com.wei.duowan.bbs.ui.adapter.BaseViewHolder;

import java.util.Arrays;

import butterknife.Bind;
import butterknife.ButterKnife;


/**
 * 作者：赵若位
 * 时间：2019/10/17 10:53
 * 联系方式：1070138445
 * 功能：绑定账号
 */
public class BindAccountActivity extends BaseActivity
{
    @Bind(R.id.recyclerView)
    RecyclerView mRecyclerView;

    private BaseRecyclerViewAdapter mAdapter;

    @Override
    protected BasePresenter createPresenter()
    {
        return null;
    }

    @Override
    protected int getLayoutID()
    {
        return R.layout.activity_bind_account;
    }

    @Override
    protected void initView()
    {
        setTitle(R.string.app_name);
        setFinish();

        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mAdapter = new BaseRecyclerViewAdapter<String>(this, R.layout.layout_bind_account)
        {
            @Override
            protected void convert(int position, @Nullable BaseViewHolder holder, @Nullable String s)
            {
                holder.setText(R.id.tv_title, s)
                        .setText(R.id.tv_descript, "绑定")
                        .setVisibility(R.id.tv_line, position == mList.size() - 1 ? View.GONE : View.VISIBLE);
            }

        };
        mAdapter.bindRecyclerView(mRecyclerView);


        mAdapter.setNewData(Arrays.asList(new String[]
                {
                        "QQ",
                        "微信",
                        "微博",
                }));
    }

}
